version: '3'

volumes:
  pg_data:
  static:
  media:

services:
  db_1:
    image: postgres:13.10
    env_file: .env
    volumes:
      - pg_data:/var/lib/postgresql/data
  backend:
    image: izida/kittygram_backend
    env_file: .env
    volumes:
      - static:/static/
      - media:/app/media/
    depends_on:
      - db_1
  frontend:
    image: izida/kittygram_frontend
    env_file: .env
    command: cp -r /app/build/. /static/
    volumes:
      - static:/static
  gateway:
    image: izida/kittygram_nginx
    env_file: .env
    ports:
      - 9000:80
    volumes:
      - static:/static
      - media:/app/media/
    depends_on:
      - backend
